<!DOCTYPE html>
<html>
<head>
    <title>商户生产</title>
    <#include "/header.html">
    <!-- 图片预览 -->
    <link rel="stylesheet" href="${request.contextPath}/statics/plugins/viewer/viewer.min.css">
    <script src="${request.contextPath}/statics/plugins/viewer/viewer.min.js"></script>
    <style>
        #jqGrid tr td{
            vertical-align: middle;
        }
        .el-row {
            margin-bottom: 20px;
        &:last-child {
             margin-bottom: 0;
         }
        }
    </style>

</head>
<body>
<div id="rrapp" v-cloak>
    <!-- 列表 -->
    <div v-show="showList">
        <div class="grid-btn">
            <!-- 查询 start -->
            <form class="form-inline" role="form">
                <a class="btn btn-default btn-sm" @click="reset"><i class="fa fa-refresh"></i></a>

                <div class="form-group">
                    <input type="text" class="form-control input-sm" v-model.trim="q.orderNo" @keyup.enter="query"
                           placeholder="原订单号">
                </div>&nbsp;&nbsp;&nbsp;

                <div class="form-group">
                    <input type="text" class="form-control input-sm" v-model.trim="q.productionOrder" @keyup.enter="query"
                           placeholder="第三方单号">
                </div>&nbsp;&nbsp;&nbsp;

                <div class="form-group">
                    <select class="form-control input-sm" v-model="q.productionStatus" @keyup.enter="query">
                        <option value="">生产状态</option>
                        <option v-for="item in e.orderProductionStatusEnum" :value="item.id">{{item.describe}}</option>
                    </select>
                </div>&nbsp;&nbsp;&nbsp;

                <div class="form-group">
                    <select class="form-control input-sm" v-model="q.allotReceivedStatus" @keyup.enter="query">
                        <option value="">验货状态</option>
                        <option value="0">待验货</option>
                        <option value="1">已验货</option>
                    </select>
                </div>&nbsp;&nbsp;&nbsp;

                <a class="btn btn-default btn-sm"  @click="query"><i class="fa fa-search"></i>&nbsp;查询</a>

            </form>
            <!-- 查询 end -->
        </div>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <!-- 订单详情 -->
    <div v-show="showOrder">

        <!-- 操作 start -->
        <div class="panel-default" style="display: block;margin-bottom: 10px;" align="center">
            <!-- 审核 -->
            <div style="padding: 5px 0;" class="container">
                <div class="row">
                    <div>
                        <el-button size="small" class="pull-center" style="width: 100px;" @click="showList = true, showOrder = false;">返回</el-button>
                    </div>
                </div>
            </div>
        </div>
        <!-- 操作 end -->

        <!-- 订单信息 start -->
        <el-row>
            <el-card class="box-card">
                <div slot="header" class="clearfix">
                    <span>订单编号：&nbsp;&nbsp;{{orderInfo.orderId}}</span>
                </div>
                <div class="text item">
                    <div class="row" style="line-height:30px;font-size: 12px;">
                        <div class="col-md-3">
                            <div class="row">
                                <div class="col-md-8 text-right">商品总额 ：</div>
                                <div class="col-md-4">{{orderInfo.totalAmount}}</div>
                            </div>
                            <div class="row">
                                <div class="col-md-8 text-right">运费 ：</div>
                                <div class="col-md-4">{{orderInfo.costFreight}}</div>
                            </div>
                            <div class="row">
                                <div class="col-md-8 text-right">支付金额 ：</div>
                                <div class="col-md-4">{{orderInfo.payed}}</div>
                            </div>

                        </div>
                        <div class="col-md-2">
                            <div class="row">
                                <div class="col-md-8 text-right">商品促销优惠 ：</div>
                                <div class="col-md-4">{{orderInfo.pmtGoods}}</div>
                            </div>
                            <div class="row">
                                <div class="col-md-8 text-right">优惠卷优惠 ：</div>
                                <div class="col-md-4">{{orderInfo.pmtOrder}}</div>
                            </div>
                            <div class="row">
                                <div class="col-md-8 text-right">随机立减 ：</div>
                                <div class="col-md-4">{{orderInfo.pmtRandom}}</div>
                            </div>
                        </div>
                        <div class="col-md-2">
                            <div class="row" style="line-height: 45px">
                                <div class="col-md-6 text-right">客服 ：</div>
                                <div class="col-md-6">
                                    <el-select v-model="erpOrder.csId" filterable placeholder="请选择" size="mini">
                                        <el-option v-for="item in csIdList" :key="item.userId + ''" :label="item.username" :value="item.userId + ''" :disabled="item.disabled"></el-option>
                                    </el-select>
                                </div>
                            </div>
                            <div class="row" style="line-height: 45px">
                                <div class="col-md-6 text-right">跟单员 ：</div>
                                <div class="col-md-6">
                                    <el-select v-model="erpOrder.pmcId" filterable placeholder="请选择" size="mini">
                                        <el-option v-for="item in pmcIdList" :key="item.userId + ''" :label="item.username" :value="item.userId + ''" :disabled="item.disabled"></el-option>
                                        </el-option>
                                    </el-select>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-5">
                            <div class="row">
                                <div class="col-md-3 text-right">审核人 ：</div>
                                <div class="col-md-4">{{erpOrder.auditNameVal}}</div>
                            </div>
                            <div class="row">
                                <div class="col-md-3 text-right">客户留言 ：</div>
                                <div class="col-md-9">
                                    {{erpOrder.memo}}
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-md-3 text-right">客服备注 ：</div>
                                <div class="col-md-9">
                                    <div class="box-body" style="line-height: 10px;margin-top: 10px;">
                                        <ul class="list-unstyled"  v-for="(remark, index) in remarkList">
                                            <li>
                                                <p style = "line-height:20px">
                                                    {{remark.orCreateTime}} {{remark.orCreateNameVal}}： {{remark.orRemarks}}
                                                </p>
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </el-card>
        </el-row>
        <!-- 订单信息 end -->

        <!-- 支付信息 start -->
        <el-row>
            <el-card class="box-card">
                <div slot="header" class="clearfix">
                    <span>支付信息</span>
                </div>
                <div class="text item">
                    <el-table border stripe ref="multipleTable" :data="userPaymentList"
                              tooltip-effect="dark" size="mini">
                        <el-table-column prop="paymentId" label="支付单号" align='center' header-align="center"></el-table-column>
                        <el-table-column prop="payName" label="支付类型" align='center' header-align="center"></el-table-column>
                        <el-table-column prop="money" label="支付金额" align='center' header-align="center"></el-table-column>
                        <el-table-column prop="tpayed" label="支付时间" align='center' header-align="center"></el-table-column>
                    </el-table>
                </div>
            </el-card>
        </el-row>
        <!-- 支付信息 end -->

        <!-- 商品信息 start -->
        <el-row>
            <el-card class="box-card">
                <div slot="header" class="clearfix">
                    <span>商品信息</span>
                </div>
                <div class="text item">
                    <el-table border stripe ref="multipleTable" :data="erpOrderItemEntityList"
                              tooltip-effect="dark" size="mini">
                        <el-table-column prop="goodsId" label="SPU" width="80" align='center' header-align="center"></el-table-column>
                        <el-table-column prop="name" label="商品名称" show-overflow-tooltip align='center' header-align="center"></el-table-column>
                        <el-table-column prop="addon" label="规格/尺寸/材质/工艺" min-width="200px" header-align="center"></el-table-column>
                        <el-table-column prop="addcartBuyType" label="类型" width="80" align='center' header-align="center">
                            <template  slot-scope="scope">
                                <template v-if="scope.row.addcartBuyType == item.value" v-for="item in e.goodsTypeEnum">
                                    {{item.describe}}
                                </template>
                            </template>
                        </el-table-column>
                        <el-table-column prop="nums" label="数量" width="80" align='center' header-align="center"></el-table-column>
                        <el-table-column prop="unit" label="单位" width="80" align='center' header-align="center"></el-table-column>
                        <el-table-column prop="allotStatus" label="分配状态" width="80" align='center' header-align="center">
                            <template slot-scope="scope">
                                {{scope.row.status == 1 ? '未分配' : '已分配'}}
                            </template>
                        </el-table-column>
                    </el-table>
                </div>
            </el-card>
        </el-row>
        <!-- 商品信息 end -->

        <!-- 商品分配列表 start -->
        <el-row>
            <el-card class="box-card">
                <div slot="header" class="clearfix">
                    <span>商品分配列表</span>
                </div>
                <div class="text item">
                    <el-table border stripe ref="multipleTable" :data="erpOrderProductionList"
                              tooltip-effect="dark" size="mini">
                        <el-table-column type="index" label="序号" align='center' header-align="center"></el-table-column>
                        <el-table-column prop="erpItemName" label="商品名称" align='center' header-align="center"></el-table-column>
                        <el-table-column prop="attributeName" label="工艺" align='center' header-align="center"></el-table-column>
                        <el-table-column prop="producerName" label="供应商" align='center' header-align="center"></el-table-column>
                        <el-table-column prop="cost" label="分配价格" align='center' header-align="center"></el-table-column>
                        <el-table-column prop="allotType" label="分配类型" align='center' header-align="center"></el-table-column>
                        <el-table-column prop="isOwn" label="是否自做" align='center' header-align="center">
                            <template slot-scope="scope">
                                {{scope.row.isOwn == 1 ? '是' : '否'}}
                            </template>
                        </el-table-column>
                        <el-table-column prop="csRemark" label="备注" header-align="center"></el-table-column>
                        <el-table-column prop="productionOrder" label="第三方单号" align='center' header-align="center"></el-table-column>
                    </el-table>
                </div>
            </el-card>
        </el-row>
        <!-- 商品分配列表 end -->
    </div>

</div>

<script src="${request.contextPath}/statics/js/modules/production/sellerproduction.js?_${.now?long}"></script>
</body>
</html>